import axios from 'axios';
import OpenAI from "openai";

const DEEPSEEK_API_KEY = '这里换成你自己的deepseek的api啦';

const deepseekApi = axios.create({
  baseURL: '/api/deepseek',
  headers: {
    'Authorization': `Bearer ${DEEPSEEK_API_KEY}`
  }
});

const openai = new OpenAI({
        baseURL: 'https://api.deepseek.com',
        apiKey: DEEPSEEK_API_KEY,
        dangerouslyAllowBrowser: true
});
export { deepseekApi };
async function main() {
  const completion = await openai.chat.completions.create({
    messages: [{ role: "system", content: "You are a helpful assistant." }],
    model: "deepseek-chat",
  });
  console.log(completion.choices[0].message.content);
  
}


main();